package com.boot.utils;


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class ADBTest {


    public static void main(String[] args) {

        try {
            Runtime runtime=Runtime.getRuntime();
            String commands[] = { "cmd.exe","/c","adb devices"};
            ProcessBuilder builder = new ProcessBuilder(commands);
            Process p = runtime.exec("adb devices");
            BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
            String line;
            while ((line = reader.readLine()) != null) {
                System.out.println(line + "\n");
            }
            p.waitFor();
            reader.close();
            p.destroy();

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
